home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dash.prerm < prev    next >
Text File  |  2008-06-20  |  616b  |  35 lines

  1. #!/bin/sh
  2. #
  3. # pre-removal script for the Debian GNU/Linux ash package
  4. #
  5. # $Id: dash.prerm,v 1.2 2003/09/03 10:42:08 herbert Exp $
  6.  
  7. set -e
  8.  
  9. remove_divert() {
  10.     div=$(dpkg-divert --list $1)
  11.     if [ -n "$div" ] && [ -z "${div%%*by dash}" ]; then
  12.         distrib=${div% by dash}
  13.         distrib=${distrib##* to }
  14.         mv $distrib $1
  15.         dpkg-divert --remove $1
  16.     fi
  17. }
  18.  
  19. remove_shell() {
  20.     if ! type remove-shell > /dev/null 2>&1; then
  21.         return
  22.     fi
  23.  
  24.     remove-shell /bin/dash
  25. }
  26.  
  27. if [ "$1" = remove ] || [ "$1" = deconfigure ]; then
  28.     remove_divert /bin/sh
  29.     remove_divert /usr/share/man/man1/sh.1.gz
  30. fi
  31.  
  32. if [ "$1" = remove ]; then
  33.     remove_shell
  34. fi
  35.